import dayjs from 'dayjs';

export function transformTime(item: any = {}) {
  if (item.time) {
    return {
      ...item,
      time: undefined,
      endTime: dayjs(item.time[1]).format('YYYY-MM-DD')+" 23:59:59",
      beginTime: dayjs(item.time[0]).format('YYYY-MM-DD')+" 00:00:01",
    };
  }
  return item;
}


export function transformTime1(item: any = {}) {
  if (item.time) {
    return {
      ...item,
      time: undefined,
      endTime: dayjs(item.time[1]).format('YYYYMMDD'),
      beginTime: dayjs(item.time[0]).format('YYYYMMDD'),
    };
  }
  return item;
}
